<?php
use yii\helpers\Url;
use yii\helpers\Json;
use yii\helpers\ArrayHelper;
use yii\web\Session;
use app\components\JSSDK;
use app\modules\Member\models\Member;

$this->title = $models->name;

//图标
$iconfont = [ 
		1=>'&#xe96e;',
		2=>'&#xe6ba;',
		3=>'&#xe6ba;',
		4=>'&#xe6ba;',
		5=>'&#xe96e;',
		6=>'&#xe96e;',
	]; 
//星期
$weekday = ['日','一','二','三','四','五','六'];


$jssdk = new JSSDK("wxdf104a667847eb11", "1e1b098e7c4f442d94fe3499463238f2");
$signPackage = $jssdk->GetSignPackage();
?>


<?= yii\web\View::registerCssFile("/css/front/lines.css",['depends' => 'app\assets\MuiAsset']) ?>
<?= yii\web\View::registerCssFile("/mui/css/previewimage.css",['depends' => 'app\assets\MuiAsset']) ?>

<style type="text/css">

.icon2{font-size: 16px;color:rgb(41, 167, 226);}
.img-num{color: #FFF;background-color: rgba(10, 10, 10,0.666667);bottom:30px;position: absolute;right:0px;width: 60px;line-height: 30px;text-align: center;border-top-left-radius:1em;border-bottom-left-radius:1em;}
.mui-bar-transparent{top:0;background-color:rgba(252,122,146,0) !important;-webkit-box-shadow:none;box-shadow:none}
.color-w{color: #FFF !important;}
.color-b{color: #000 !important;}

.icon3{font-size: 14px;color:#a664a6;}
.icon4{font-size: 18px;color:#FEC172;}
.font_c{color: #f60}
.font_b{color: rgb(41, 167, 226);}
.mui-segmented-control .mui-control-item.mui-active{background-color:rgb(255, 255, 255);color: #333;border-bottom:2px solid #a664a6 !important;}
.mui-segmented-control .mui-control-item{color: #999;} 
 .mui-btn-outlined.mui-btn-primary{color: rgb(41, 167, 226);border:1px solid rgb(41, 167, 226);}
.left_head{color: rgb(41, 167, 226);font-size:0.8em;line-height:20px;} 
.mui-checkbox input[type=checkbox]:before, .mui-radio input[type=radio]:before{
	font-size: 20px;
}
.mui-checkbox input[type=checkbox], .mui-radio input[type=radio]{top:8px;}
.mui-checkbox.mui-left input[type=checkbox], .mui-radio.mui-left input[type=radio]{
	left: 10px;
}
.mui-checkbox.mui-left label, .mui-radio.mui-left label{padding-left:36px;}
.mui-checkbox input[type=checkbox]:checked:before, .mui-radio input[type=radio]:checked:before{color: #a664a6;}
.mui-table-view:before{background-color:#FFF;}


.tag-f{font-size: 1rem}
.tag-g{border-left: 2px solid #a664a6;padding-left: 5px;font-size: 1rem;}
.tag-l{font-size: 0.8rem;}
.new-detail{background-color: #FFFFFF;padding:10px;}
.code-btn{background-color: #02D9CA;border:1px solid #02D9CA;color: #FFFFFF;border-radius: 3px;width: 32px;height: 20px;display: block;float: left;margin-right: 3px;line-height: 20px;text-align: center;}
.code{background-color: #02D9CA;border:1px solid #02D9CA;color: #FFFFFF;padding:1px;border-radius: 3px;}
.code2{background-color: #FC7C93;border:1px solid #FC7C93;color: #FFFFFF;padding:1px;border-radius: 3px;}
.code3{background-color: #DC74FE;border:1px solid #DC74FE;color: #FFFFFF;padding:1px;border-radius: 3px;}
.theme1_info_c:after{left:0;background-color: transparent;}

.left_head{color: #FDAD38 !important;font-size:1rem !important; margin: 0 !important;}
.icon12{color: #FDAD38;}

 .c{height:70px;width:70px;border-radius: 50%;border:1px solid #ddd;text-align: center;}
 .c .sp1{display: block;margin-top: 15px;font-size: 1rem;color: #999;}
 .c .sp2{font-size: 1.2rem}
 .c2{height:70px;width:70px;border-radius: 50%;border:1px solid #a664a6;text-align: center;color: #a664a6;}
 .c2 .sp1{display: block;margin-top: 15px;font-size: 1rem;}
 .c2 .sp2{font-size: 1.2rem}

 .theme1_info_c_r:after {
    position: absolute;
    right: 0;
    bottom: 0;
    top:10px;
    left: 0;
    height:100%;
    width: 1px;
    content: '';
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
    background-color: #c8c7cc;}
  .panel_wrap{padding: 5px 5px 0 5px;}
  .panel-box{background-color: #fff;border-radius: 4px;box-shadow: 0 1px 0 rgba(219,213,213,.75);overflow: hidden;}
  .panel-box-cell{margin-bottom: 10px;}
  .panel-box-title{border-left: 2px solid #a664a6;padding-left: 10px;color: #333}
  .mui-table-view-cell:after{left:0} 
  .mui-table-view{background-color:#efeff4;}
  .mui-table-view-cell{background-color: #FFF;/*margin-top: 10px;*/}
  .margin-10{margin:0 10px 10px 10px;}
  .a-btn-ground{background: -webkit-linear-gradient(left,#a664a6,#dea0c7);
    background: linear-gradient(to right,#a664a6,#dea0c7);
    right: 0px;
    top: 0px;
    display: inline-block;
    padding: 0 18px 0 12px;
    height: 20px;
    line-height: 20px;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    position: relative;
}
  .a-btn-ground:after{
  	position: absolute;
  	top: 6px;
    right: 9px;
    width: 7px;
    height: 7px;
    content: '';
    border: 2px solid #fff;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);} 
   .tips{padding: 40px 0 40px 0;} 

.list-block .item-text-all{font-size:14px;color: #333;line-height: 1.05rem;
    position: relative;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    display: -webkit-box;}
.list-block .item-text{font-size:14px;
    color: #333;
    line-height: 1.05rem;
    position: relative;
    overflow: hidden;
    height: 2rem;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;}   
.show{color:#a664a6}      
</style>

<input type="hidden" id="_member" value="">

<div class="mui-content">
	<div class="panel_wrap">
		<div class="panel-box mui-row new-detail">
			<div class="mui-col-xs-4">
				
					<?php if(isset($models->image->path)) { ?>
					<img src="<?=\Yii::$app->params['qiniu_path'].$models->image->path.'?imageView2/1/w/480/h/480'?>" width=100px height=100px style="border-radius:50%;vertical-align: middle;" >
					<?php }else{ ?>
						<img  src="/img/load.jpg" width=100px height=100px style="border-radius:50%;vertical-align: middle;" >
					<?php } ?>
				
			</div>
			<div class="mui-col-xs-8" style="margin-top: 10px;">
				<div class="mui-row">	
					<div class="mui-col-xs-12">
						 <span style="color: #333;font-size:1rem;"><?=$models->name?></span>
					</div>
					<div class="mui-col-xs-12" style="font-size:0.8rem;color: #666;"><?=\yii::$app->formatter->asDate($models->go_time);?> / <?=yii::$app->params['city'][$models->from_city]?>出发
					</div>
					
				</div>
				<div class="mui-row">
					<div class="mui-col-xs-6"><span style="font-size:1.2rem;color: #f60">¥<?=floor($models->minPrice)?></span><span style="font-size:0.6rem;color: #666">起/人</span></div>
					<div class="mui-col-xs-6"><span class="mui-pull-right follow" style="font-size:14px;color: #a664a6;height:30px;line-height: 30px;margin-right: 15px;"><i class="iconfont" style="font-size:30px;vertical-align: middle;-webkit-text-stroke-width: 0px;">&#xe6bd;</i></span></div>
				</div>
			</div>
		</div>

		<?php if($models->sale){ ?>
		<div class="panel-box mui-row list-block" style="background-color: #FFF;padding: 10px;margin-top: 10px">
			<div class="sale-h" style="font-size: 1rem;color: red;">优惠信息</div>
			<div class="item-text" id="item-text" style="font-size:1rem;margin-top: 10px;">
				<?=$models->sale?>
			</div>
			<div class="mui-pull-right" style="margin-right:10px;font-size: 14px;margin-top: 10px;">
                <span class="show blue" id="show-text"><i class="iconfont" style="vertical-align: middle;">&#xe72c;</i></span>
            </div> 
		</div>
		<?php }?>

		<div class="panel-box mui-row" style="background-color: #FFF;padding: 10px;margin-top: 10px">
			<div  style="margin-bottom:5px;padding-bottom:5px;border-bottom: 1px solid #ddd">
				<span class="tag-f">邮轮信息</span>
				<div class="mui-pull-right"><a data-link="as" href="<?=Url::toRoute(['cruise','id'=>$cruise->id])?>" class="a-btn-ground">邮轮详情</a></div>
			</div>
			<div class="mui-row">
				  <?php foreach($img as $sk=>$sv){ ?>
			     	<?php if($sk==4){;?>
			     	<?php break;?>		
			     	<?php }?>
			     	   <div class="mui-col-xs-3"><img src="<?=\Yii::$app->params['qiniu_path'].$sv->path.'?imageView2/1/w/200/h/200';?>" data-preview-src="<?=\Yii::$app->params['qiniu_path'].$sv->path.'?imageView2/1/w/640/h/480'?>" style="width:80px;height: 80px" data-preview-group="1" /></div>
			     <?php }?>
			</div>

		</div>
		<?php if(\Yii::$app->user->can('room_stock')){?>
		<div class="panel-box mui-row" style="background-color: #FFF;padding: 10px;margin-top: 10px">
			<div  style="margin-bottom:5px;padding-bottom:5px;border-bottom: 1px solid #ddd">
				<span class="tag-f">邮轮库存</span>
				<div class="mui-pull-right">
					<a data-link="as" href="<?=Url::toRoute(['line-room','id'=>$models->id])?>" class="a-btn-ground">查看更多</a></div>
			</div>
			<?php if(\Yii::$app->user->can('room_create')){?>
			<div class="mui-row" style="padding-top: 5px;">
				  <div class="mui-col-xs-3">
				  	   <div class="c">
				  	   		<span class="sp1">总数</span>
				  	   		<span class="sp2"><?=$stock['total']?></span>
				  	   </div>
				  </div>
				  <div class="mui-col-xs-3">
				  		<div class="c">
				  	   		<span class="sp1">售出</span>
				  	   		<span class="sp2"><?=$stock['sell_num']?></span>
				  	   </div>
				  </div>
				  <div class="mui-col-xs-3">
				  		<div class="c">
				  	   		<span class="sp1">占位</span>
				  	   		<span class="sp2"><?=$stock['occupy_num']?></span>
				  	   </div>
				  </div>
				  <div class="mui-col-xs-3">
				  		<div class="c2">
				  	   		<span class="sp1">剩余</span>
				  	   		<span class="sp2"><?=$stock['stock']?></span>
				  	   </div>
				  </div>
			</div>
			<?php }?>
		</div>
		<?php }?>
	


		<div class="panel-box" style="margin-top:10px;background-color: #FFF;">
			<div class="mui-segmented-control">
				<div class="mui-row">
					<div class="mui-col-xs-3">
					<a class="mui-control-item mui-active" href="#item1">
						行程详细
					</a>
					</div>
					<div class="mui-col-xs-3">
					<a class="mui-control-item" href="#item2">
						价目表
					</a>
					</div>
					<div class="mui-col-xs-3">
					<a class="mui-control-item" href="#item3">
						订购须知
					</a>
					</div>
					<div class="mui-col-xs-3">
					<a class="mui-control-item" href="#item4">
						其他航期
					</a>
					</div>
				</div>
			</div>
	 	</div>
	 	
	 	<div  style="margin-top: 10px;margin-bottom: 10px;">
				<div id="item1" class="mui-control-content mui-active">
					<div class="panel-box">	
						<ul class="mui-table-view">
						<?php
							$trip_img = [];
							if(!empty($models->trip_img)){
								$trip_img = json_decode($models->trip_img,true);
							}
						?>		
						<?php if(!empty($models->trip)){
							$trips = Json::decode($models->trip);
						 	//ksort($trips);
							$d = 0;
							foreach ($trips as $key => $val) {?>
								<?php $d++;
									$day = $d - 1;
								?>
							<li class="mui-table-view-cell theme1_info_c">
								<div class="mui-row">
										<div class="mui-col-xs-1">
											<div class="mui-pull-right" style="margin-right: 8px;"><?=sprintf("<i class='iconfont icon12'>%s</i>",$iconfont[$val['type']]);?>
												<div style="width: 8px;height:8px;background-color: transparent; border: 1px #FDAD38 solid;-webkit-border-radius: 4px;border-radius: 4px;right: -4px;position: absolute;top: 2px;">
												</div>
											</div>
											
										</div>
										
										<div class="mui-col-xs-11 theme1_info_c_r">
											<p class="left_head">D<?=$d?>&nbsp;&nbsp;<?=date("m.d",strtotime("+$day  day",strtotime($models->go_time)))?>&nbsp;&nbsp;星期<?=$weekday[date("w",strtotime("+$day day",strtotime($models->go_time)))]?>
											</p>
											
											<p class="sed_head" style="color: #333;font-size: 0.9rem;">
												<?=$val['title'];?> 
												<?php if(!empty($val['time1'])){?>
													 &nbsp;&nbsp;<?=$val['time1']?> 抵港 
												<?php };?>
												<?php if(!empty($val['time2'])){?>
													 &nbsp;&nbsp;<?=$val['time2']?> 启航
												<?php };?>
											</p>
											
										
											<p style="color: #333;font-size: 0.9rem;">
											<?php if(!empty($val['eat'])){?>
											<?=sprintf("餐饮：%s&nbsp;&nbsp;&nbsp;",$val['eat'])?>
											<?php }?>
											<?php if(!empty($val['room'])){?>
											<?=sprintf("住宿：%s",$val['room'])?>
											<?php }?>
											</p>
											<?php if(isset($trip_img[$key]) && !empty($trip_img[$key])){ ?>
												  <?php foreach($trip_img[$key] as $tripImg){ ?>
											<p>
												<img src="<?=\Yii::$app->params['qiniu_path'].$tripImg.'?imageView2/2/w/360/'?>">
											</p>		  
												  <?php }?>
											<?php }?>
											<p style="background-color: #f7f7f7;border:1px solid #ddd;padding: 5px;border-radius: 3px;"><?=$val['desc']?></p>
											<?php if(isset($val['visit']) && !empty($val['visit'])){ ?>
										
												 <?php $nums = 0;?>
											     <?php foreach($val['visit'] as $v){ ?>
											     <?php $nums ++;?>
											       <?php if(!empty($v['name'])){ ?> 
											        <?php if($nums == 1){ ?>
											        <p style="color: #333;font-size: 0.9rem;">
														岸上游览：
													</p>
											        <?php }?>	
											       		<div style="color: #333;font-size: 0.9rem;margin-top: 10px;background-color: #f7f7f7;border: 1px solid #ddd;border-radius: 3px;">
											       			<div class="mui-row title visit_add" style="border-bottom: 1px solid #ddd;padding: 5px;">
											       				<div class="mui-col-xs-11">项目：<?=$v['name']?><br>价格：<?=$v['price']?>
											       				</div>
											       				<div class="mui-col-xs-1 mui-pull-right">
											       					<i class="iconfont visit_font">&#xe60f;</i>
											       				</div>
											       			</div>
											       			<div class="desc" style="padding: 5px;display: none;"><?=$v['content']?>
											       			</div>	
											       		</div>
											       <?php }?>
											     <?php }?>
											<?php }?>
										</div>
								</div>		
							</li>
						<?php };?>	
						<?php }else{?>
							<div class="panel-box panel-box-cell tips">
								<li class="mui-table-view-cell theme1_info_c" style="text-align: center;">暂无行程
								</li>
							</div>
						<?php };?>	
						</ul>
					</div>		
					
				</div>
				<div id="item2" class="mui-control-content">
						
						<?php if($models->stock == 1){  //标准库存格式 ?>
									
								<?php if(!empty($in_room)){?>
								 	
								 	<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">内舱房</span>
											</div>
										</div>
										<div class="mui-row tag-l">
									  <?php foreach($in_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
									  <?php }?>
									  </div>
									</div> 
									
								<?php };?>
						

								<?php if(!empty($sea_room)){?>
									<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">海景房</span>
											</div>
										</div>
										<div class="mui-row tag-l">
									  <?php foreach($sea_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
										  <?php }?>
										  </div>
									 </div>
									
								<?php };?>

								<?php if(!empty($bal_room)){?>
									<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">阳台房</span>
											</div>
										</div>	
										<div class="mui-row tag-l">
									  <?php foreach($bal_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												   <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
									  <?php }?>
									  </div>
									  </div>
								<?php };?>

								<?php if(!empty($sui_room)){?>
									<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">普通套房</span>
											</div>
										</div>	
										<div class="mui-row tag-l">
									  <?php foreach($sui_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
									  <?php }?>
									   </div>
									  </div>						 
								<?php };?>

								<?php if(!empty($high_room)){?>
									<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">高级套房</span>
											</div>
										</div>	
										<div class="mui-row tag-l">
									  <?php foreach($high_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
									  <?php }?>
									   </div>
									  </div>						 
								<?php };?>

								<?php if(!empty($other_room)){?>
									
									<div class="panel-box panel-box-cell">
									 	<div style="background-color: #FFF;padding: 10px;">
									 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
											<span class="tag-g">其他</span>
											</div>
										</div>			
										<div class="mui-row tag-l">
									
									  <?php foreach($other_room as $v){?>
									  		<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code-btn"><?=$v['code']?></span>
												    <?=$v['name']?>
												    <?=sprintf("(%s层)",yii::$app->ceils->getCeils($v['ceil']));?>
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;">&nbsp;¥<?=floor($v['price'])?>
												    <?php if(!\Yii::$app->user->isGuest){ ?>
												    <span class="font_b mui-block"><?= sprintf("&nbsp;¥%s",floor($v['inside_price']));?></span>
												    <?php }?>
												    </div>
												    </div>
											    </div>
											 </div>
									  <?php }?>
									  </div>
									 </div>					
								<?php };?>
								 
						
						<?php }else if($models->stock == 2){ ?> 
						
							 <?php if(!empty($models->rooms)){?>
							 <?php 	$Modelrooms = json_decode($models->rooms,true);?>
								 <?php 	if(is_array($Modelrooms)){?>
								 	<?php foreach($Modelrooms as $val){ 
											if(empty($val['name'])){
												continue;
											}
									?>
									<div class="panel-box panel-box-cell">
								 	<div style="background-color: #FFF;padding: 10px;">
								 		<div style="border-bottom: 1px solid #ddd;padding-bottom:5px;">
										<span class="tag-g"><?=$val['name']?></span>
										</div>
									</div>
										<div class="mui-row tag-l">
								 				<?php if(!empty($val['price'])){?>
								 				<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code2">售</span>
												    第1/2人价格
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;"><?= sprintf("¥%s",floor($val['price']));?></div>
												    </div>
											    </div>
											 	</div>
								 				<?php }?>

								 				<?php if(!\Yii::$app->user->isGuest){ ?>
								 				<?php if(!empty($val['inside_price'])){?>	
								 				<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code">同</span>
												    第1/2人同业价格
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;"><?= sprintf("¥%s",floor($val['inside_price']));?></div>
												    </div>
											    </div>
											 	</div>
								 				<?php }?>
								 				<?php }?>
								 			
								 			<?php if(!empty($val['price2'])){?>
								 				<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code2">售</span>
												    第3/4人价格
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;"><?= sprintf("¥%s",floor($val['price2']));?></div>
												    </div>
											    </div>
											 	</div>
								 				
								 			<?php }?>

								 			<?php if(!\Yii::$app->user->isGuest){ ?>
								 			<?php if(!empty($val['inside_price2'])){?>
								 				<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code">同</span>
												    第3/4人同业价格
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;"><?= sprintf("¥%s",floor($val['inside_price2']));?></div>
												    </div>
											    </div>
											 	</div>
								 				
								 			<?php }?>	
								 			<?php }?>

								 			<?php if(!empty($val['difference'])){?>
								 				<div class="mui-col-xs-12">
									  			<div class="mui-row margin-10">
										  			<div class="mui-col-xs-9">
										  			<span class="code3">差</span>
												    单间差
												    </div>
												    <div class="mui-col-xs-3 font_c"><div class="mui-pull-right" style="margin-right: 5px;"><?=sprintf("¥%s",floor($val['difference']));?></div>
												    </div>
											    </div>
											 	</div>
								 				
								 			<?php }?>		
								 		 </div>
								 		 </div>	
								 		 
								 		
								 	<?php }?>

								 <?php  }?>	

							 <?php }?>
						<?php }?>

						 <?php if(!empty($models->room_remark)){?>
						  		
									<div style="background-color: #f2f2f2;padding: 10px;color: #999;font-size: 0.9rem">
										<div class="mui-row">
											备注：
											<?=$models->room_remark?>
										</div>
										
									</div>
								
						  <?php }?>
								  
				</div>
				<div id="item3" class="mui-control-content">
					<ul class="mui-table-view">
								<?php if(!empty($models->cost)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;"><span class="panel-box-title">费用包含</span></p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->cost?>
										</div>
									</li>
								</div>	
								<?php }?>	
								<?php if(!empty($models->nocost)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span  class="panel-box-title" >费用不包含</span>
											</p>
											
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->nocost?>
										</div>
									</li>
								</div>	
								<?php }?>
								<?php if(!empty($models->cancel)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">取消政策</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->cancel?>
										</div>
									</li>
								</div>	
								<?php }?>	
								<?php if(!empty($models->discount)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">优惠说明</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->discount?>
										</div>
									</li>
								</div>	
								<?php }?>
								<?php if(!empty($models->visa)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">签证说明</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->visa?>
										</div>
									</li>
								</div>	
								<?php }?>	
								<?php if(!empty($models->signup)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">报名须知</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->signup?>
										</div>
									</li>
								</div>	
								<?php }?>
								<?php if(!empty($models->land)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">岸上游</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->land?>
										</div>
									</li>
								</div>	
								<?php }?>	
								<?php if(!empty($models->expense)){?>
								<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell">
										<div class="theme3_info_header">
											<p style="font-size:1rem;margin-right: 10px;">
											<span class="panel-box-title">自费项目</span>
											</p>
										</div>
										<div class="theme3_info_c" style="width: 100%;min-width: 200px;">
											<?=$models->expense?>
										</div>
									</li>
								</div>	
								<?php }?>			
									
								
								</ul>
				</div>
				<div id="item4" class="mui-control-content">
							<ul class="mui-table-view ">
								<?php if(!empty($otherlines)){?>
									<?php foreach($otherlines as $v){?>
									<div class="panel-box panel-box-cell">
									<li class="mui-table-view-cell mui-media">
										<a data-link="as" href="<?=Url::toRoute(['lines','id'=>$v->id])?>">
											<?php if(isset($v->image->path)){ ?>
											<img class="mui-media-object mui-pull-left img-left" src="<?=\Yii::$app->params['qiniu_path'].$v->image->path.'?imageView2/1/w/180/h/180'?>" style="max-width:64px;line-height: 64px;height: 64px;">
											<?php }else{ ?>
											<img class="mui-media-object mui-pull-left img-left" src="/img/load.jpg"  style="max-width:64px;line-height: 64px;height: 64px;" >
											<?php }?>
											<div class="mui-media-body">
												<div class="mui-row color-b">
													<div class="mui-col-xs-12 col_333" style="white-space:normal;font-size: 17px;">
													<?=$v->name?>
													</div>
												</div>
				               
				                          	  <p style="margin-top:5px;margin-bottom: 5px;color: #666">
				                                <i class="iconfont icon3">&#xe668;</i>&nbsp;<?=\yii::$app->formatter->asDate($v->go_time);?> / <?=yii::$app->params['city'][$v->from_city]?>出发
				                            	</p>
				                            	<p style="margin-bottom: 5px;color: #666">¥
				                            	  <span  style="font-size: 18px;color: #f60">
				                                    <?=yii::$app->formatter->asDecimal(floor($v->minPrice))?><span style="font-size: 12px;vertical-align:2px;color: #666;">起/人</span>
				                             	</span>
				                            	</p>
				                            </div>							
										</a>
									</li>
									</div>
									<?php };?>
								<?php }else{?>
									<div class="panel-box panel-box-cell tips">
									<li class="mui-table-view-cell">
										<p style="color: #333;text-align: center;">邮轮暂无航线</p>
									</li>
									</div>
								<?php };?>	

								
							</ul>
						
				</div>
		</div>		

	</div>		
</div>

<?= yii\web\View::registerJsFile("/mui/js/mui.zoom.js",['depends' => 'app\assets\MuiAsset']) ?>
<?= yii\web\View::registerJsFile("/mui/js/mui.previewimage.js",['depends' => 'app\assets\MuiAsset']) ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<?= yii\web\View::registerJsFile("/js/layer_mobile/layer.js",['depends' => 'app\assets\MuiAsset']) ?>

<?php app\components\JsBlock::begin() ?>
<script type="text/javascript">

(function($){

	 $("#show-text").click(function(){    
        $("#item-text").toggleClass('item-text-all');
        $("#item-text").toggleClass('item-text');
        var res = $("#item-text").hasClass('item-text-all');
        var html1 = '<i class="iconfont" style="vertical-align: middle;">&#xe6be;</i>';
        var html2 = '<i class="iconfont" style="vertical-align: middle;">&#xe72c;</i>';  
        $(this).empty();
        if(res){ 
           $(this).append(html1);
        }else{
           $(this).append(html2);
        }
    });


}(jQuery));


mui("body").on('tap','.visit_add',function(){

	jQuery(this).next().toggle(); 

 	if(jQuery(this).hasClass("active")){
 		jQuery(this).removeClass("active");
 		jQuery(this).children().find(".visit_font").replaceWith("<i class='iconfont visit_font'>&#xe60f;</i>");
 	}else{
 		jQuery(this).addClass("active");
 		jQuery(this).children().find(".visit_font").replaceWith("<i class='iconfont visit_font'>&#xe610;</i>");
 	}

 	
 	
})

mui("body").on('tap','.follow',function(){
  
    layer.open({
    	type: 1,
    	content: '<img src="/img/qrcode.jpg">'
  	})


})

mui('.mui-scroll-wrapper').scroll({
	deceleration: 0.0005 
});

mui.previewImage();

mui('body').on('tap','a[data-link="as"]',function(){document.location.href=this.href;});

document.querySelector('.mui-slider').addEventListener('slide', function(event) {
	var num = event.detail.slideNumber;
	jQuery(".cg-num").text(num+1);
});


wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: '<?php echo $signPackage["timestamp"];?>',
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
     	'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',

    ]
});


wx.ready(function(){
	var title = '<?=$cruise->name?>';
	var desc = '<?=$models->name?> <?=\yii::$app->formatter->asDate($models->go_time);?> / <?=yii::$app->params['city'][$models->from_city]?>出发';
	var link = '<?=sprintf("%s/front/default/lines?id=%s",yii::$app->request->getHostInfo(),$models->id)?>';
	var imgUrl = '<?= empty($img) ? '' :  \Yii::$app->params['qiniu_path'].$img[0]['path'].'?imageView2/1/w/640/h/420';?>';
	
	wx.onMenuShareTimeline({
		title:desc,
		desc:desc,
		link:link,
		imgUrl:imgUrl,
		trigger:function(res){
			var member =  $("#_member").val();
			var isCheck = 0;
			isCheck = $("input[name='check']:checked").val();
			if(isCheck == 1){
				this.link = link+'&member_id='+member;
			}else{
				this.link = link;
			}

			// var url = location.href;
			// var paraString = encodeURIComponent(url);
			// if(!member){
			// 	mui.confirm("您尚未登录!是否登录后再转发?","",['是', '否'],function(e){
			// 	if (e.index == 0) {
		 //            document.location.href="/member/member/login?goto="+paraString;
		 //           } 
			// 	});
			// }
		},	
		
	});
	wx.onMenuShareQQ({
		title:title,
		desc:desc,
		link:link,
		imgUrl:imgUrl,
		trigger:function(res){
			var member =  $("#_member").val();
			var isCheck = 0;
			isCheck = $("input[name='check']:checked").val();
			if(isCheck == 1){
				this.link = link+'&member_id='+member;
			}else{
				this.link = link;
			}

			// var url = location.href;
			// var paraString = encodeURIComponent(url);
			// if(!member){
			// 	mui.confirm("您尚未登录!是否登录后再转发?","",['是', '否'],function(e){
			// 	if (e.index == 0) {
		 //            document.location.href="/member/member/login?goto="+paraString;
		 //           } 
			// 	});
			// }
		},	
		
	});
	wx.onMenuShareWeibo({
		title:title,
		desc:desc,
		link:link,
		imgUrl:imgUrl,
		trigger:function(res){
			var member =  $("#_member").val();
			var isCheck = 0;
			isCheck = $("input[name='check']:checked").val();
			if(isCheck == 1){
				this.link = link+'&member_id='+member;
			}else{
				this.link = link;
			}

			// var url = location.href;
			// var paraString = encodeURIComponent(url);
			// if(!member){
			// 	mui.confirm("您尚未登录!是否登录后再转发?","",['是', '否'],function(e){
			// 	if (e.index == 0) {
		 //            document.location.href="/member/member/login?goto="+paraString;
		 //           } 
			// 	});
			// }
		},	
		
	});
	wx.onMenuShareAppMessage({
		title:title,
		desc:desc,
		link:link,
		imgUrl:imgUrl,
		trigger:function(res){
			var member =  $("#_member").val();
			var isCheck = 0;
			isCheck = $("input[name='check']:checked").val();
			if(isCheck == 1){
				this.link = link+'&member_id='+member;
			}else{
				this.link = link;
			}

			// var url = location.href;
			// var paraString = encodeURIComponent(url);
			// if(!member){
			// 	mui.confirm("您尚未登录!是否登录后再转发?","",['是', '否'],function(e){
			// 	if (e.index == 0) {
		 //            document.location.href="/member/member/login?goto="+paraString;
		 //           } 
			// 	});
			// }
		},	
		
	});
	wx.onMenuShareQZone({
		title:title,
		desc:desc,
		link:link,
		imgUrl:imgUrl,
		trigger:function(res){
			var member =  $("#_member").val();
			var isCheck = 0;
			isCheck = $("input[name='check']:checked").val();
			if(isCheck == 1){
				this.link = link+'&member_id='+member;
			}else{
				this.link = link;
			}
			// var url = location.href;
			// var paraString = encodeURIComponent(url);
			// if(!member){
			// 	mui.confirm("您尚未登录!是否登录后再转发?","",['是', '否'],function(e){
			// 	if (e.index == 0) {
		 //            document.location.href="/member/member/login?goto="+paraString;
		 //           } 
			// 	});
			// }
		},	
		
	});
	    
	
});


</script>
<?php app\components\JsBlock::end() ?>
